-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ocr3config/return active candidate #285
Conversation
commit/plugin_e2e_test.go
Outdated
@@ -721,7 +721,7 @@ func setupNode(params SetupNodeParams, nodeID commontypes.OracleID) nodeSetup { | |||
homeChainReader.EXPECT().GetFChain().Return(fChain, nil) | |||
homeChainReader.EXPECT(). | |||
GetOCRConfigs(mock.Anything, params.donID, consts.PluginTypeCommit). | |||
Return([]reader.OCR3ConfigWithMeta{{}}, nil).Maybe() | |||
Return(reader.ActiveAndCandidate{}, nil).Maybe() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rename to reader.ActiveAndCandidateConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed offline, will rename this in the future.
internal/reader/home_chain.go
Outdated
var ( | ||
ocrConfigs []OCR3ConfigWithMeta | ||
allConfigs ActiveAndCandidate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename allConfigs
to ActiveAndCandidate
. Maybe instead of ActiveCandidateConfig
rename the struct to:
type ConfigPair struct {
ActiveConfig Config
CandidateConfig Config
}
So then when we see a variable named configPair
it's cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed offline, will rename this in the future.
ref: develop | ||
ref: ccip/launcherRefactor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to revert this before merging
d1062e5
to
743f0d8
Compare
commit/plugin_e2e_test.go
Outdated
@@ -9,6 +9,8 @@ import ( | |||
"testing" | |||
"time" | |||
|
|||
ocrTypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We've been calling this ocr3types
elsewhere, nice to stay consistent
ocrTypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" | |
ocr3types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a collision in the file :(
We already have an import as "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof interesting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just ocrtypes
then
execute/test_utils.go
Outdated
@@ -14,6 +15,7 @@ import ( | |||
|
|||
"github.com/smartcontractkit/libocr/commontypes" | |||
"github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" | |||
ocr2t "github.com/smartcontractkit/libocr/offchainreporting2plus/types" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ocr2t "github.com/smartcontractkit/libocr/offchainreporting2plus/types" | |
ocr3types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, there's a collision in the file because we import github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types
|
https://smartcontract-it.atlassian.net/browse/CCIP-2687
Updates the home_chain_reader to return an 'ActiveAndCandidate' instance, rather than an array.
This is necessary for us to distinguish "HOW" to operate on changes when managing state transitions.
Previously we returned an array of two configurations, with the assumption that there would always be one active. This is not the case with keystone, where new configurations are initialized as candidates.